//
//  IOS7SearchController.h
//  SanYiSanDemo
//
//  Created by GZMLUser on 14-10-28.
//  Copyright (c) 2014年 GZMLUser. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

@protocol IOS7SearchDelegete;


@interface IOS7SearchController : UIViewController<AVCaptureMetadataOutputObjectsDelegate>

@property (strong,nonatomic)AVCaptureDevice * device;
@property (strong,nonatomic)AVCaptureDeviceInput * input;
@property (strong,nonatomic)AVCaptureMetadataOutput * output;
@property (strong,nonatomic)AVCaptureSession * captureSession;
@property (strong,nonatomic)AVCaptureVideoPreviewLayer * previewLayer;
@property (nonatomic,strong)AVCaptureVideoPreviewLayer *backViewLayer;
@property (strong,nonatomic)UIImageView *lineView;

@property (nonatomic,weak)id<IOS7SearchDelegete> delegate;

- (id)initIOS7SearchWithDelegate:(id<IOS7SearchDelegete>)scanDelegate;


- (void)startIOS72DSearch; // 开始扫描
- (void)stopIOS72DSearch; // 结束
@end

@protocol IOS7SearchDelegete <NSObject>

- (void)ios7SearchController:(IOS7SearchController *)controller didScanResult:(NSString *)result;
- (void)ios7SearchControllerDidCancel:(IOS7SearchController *)controller;
@end
